Developer Documentation

QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Converting Angles and Points

The QuickTime VR Manager provides routines that you can use to convert mathematical entities and perform other utility operations.

QTVRGetAngularUnits

You can use the QTVRGetAngularUnits function to get the type of unit currently used when specifying angles.

QTVRAngularUnits QTVRGetAngularUnits (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A constant that indicates the type of angular units currently in use. See "Angular Unit Types" for a description of the available angular unit types.

DESCRIPTION

The QTVRGetAngularUnits function returns, as its function result, a constant that indicates the type of angular unit currently used by the movie instance specified by the qtvr parameter. Angular values you pass to other QuickTime VR functions (for example, QTVRSetPanAngle ) are interpreted in those units.

SEE ALSO

Use QTVRSetAngularUnits (next) to set the type of angular unit used by a QuickTime VR movie.

QTVRSetAngularUnits

You can use the QTVRSetAngularUnits function to set the type of unit used when specifying angles.

OSErr QTVRSetAngularUnits (QTVRInstance qtvr, QTVRAngularUnits units);
qtvr
An instance of a QuickTime VR movie.
units
A constant that indicates the type of angular units to use. See "Angular Unit Types" for a description of the available angular unit types.
function result
A result code.

DESCRIPTION

The QTVRSetAngularUnits function sets the type of angular units to be used in all subsequent QuickTime VR Manager calls for the QuickTime VR movie specified by the qtvr parameter to the unit type specified by the units parameter.

SEE ALSO

Use QTVRGetAngularUnits to get the type of angular unit used by a QuickTime VR movie. Listing 2-2 illustrates the use of QTVRSetAngularUnits .

QTVRPtToAngles

You can use the QTVRPtToAngles function to get the pan and tilt angles of a point.

OSErr QTVRPtToAngles (
                     QTVRInstance qtvr,
                     Pointpt,
                     float*panAngle,
                     float*tiltAngle);
qtvr
An instance of a QuickTime VR movie.
pt
A point, in the local coordinates of the graphics world of the specified movie.
panAngle
On entry, a pointer to a floating-point value. On exit, that value contains the pan angle of the specified point.
tiltAngle
On entry, a pointer to a floating-point value. On exit, that value contains the tilt angle of the specified point.
function result
A result code.

DESCRIPTION

For a panorama, each point in the current view corresponds to a particular pan and tilt angle, with the point at the center of the view corresponding to the panorama's current pan and tilt angle. The QTVRPtToAngles function returns, in the floating-point values pointed to by the panAngle and tiltAngle parameters, the pan and tilt angles of the point specified by the pt parameter.

SPECIAL CONSIDERATIONS

QTVRPtToAngles is valid only for panoramic nodes.

QTVRCoordToAngles

You can use the QTVRCoordToAngles function to get the pan and tilt angles of a floating-point coordinate in a panorama.

OSErr QTVRCoordToAngles (
                     QTVRInstance qtvr,
                     QTVRFloatPoint*coord,
                     float*panAngle,
                     float*tiltAngle);
qtvr
An instance of a QuickTime VR movie.
coord
On entry, a pointer to a QTVRFloatPoint structure that specifies a coordinate in the full panorama.
panAngle
On entry, a pointer to a floating-point value. On exit, that value contains the pan angle of the specified coordinate.
tiltAngle
On entry, a pointer to a floating-point value. On exit, that value contains the tilt angle of the specified coordinate.
function result
A result code.

DESCRIPTION

The QTVRCoordToAngles function returns, in the floating-point values pointed to by the panAngle and tiltAngle parameters, the pan and tilt angles of the point specified by the coord parameter. This function is useful for setting up angles in a back buffer imaging procedure; if you know a coordinate in the back buffer, you can call QTVRCoordToAngles to get the corresponding angles.

SPECIAL CONSIDERATIONS

QTVRCoordToAngles is valid only for panoramic nodes.

SEE ALSO

Use QTVRAnglesToCoord (next) to get a floating-point coordinate from a pair of pan and tilt angles.

QTVRAnglesToCoord

You can use the QTVRAnglesToCoord function to get a floating-point coordinate determined by a pair of pan and tilt angles.

OSErr QTVRAnglesToCoord (
                     QTVRInstance qtvr,
                     floatpanAngle,
                     floattiltAngle,
                     QTVRFloatPoint*coord);
qtvr
An instance of a QuickTime VR movie.
panAngle
A pan angle.
tiltAngle
A tilt angle.
coord
On entry, a pointer to a QTVRFloatPoint structure. On exit, that structure is set to the coordinate of the specified movie that corresponds to the specified pan and tilt angles.
function result
A result code.

DESCRIPTION

The QTVRAnglesToCoord function returns, in the QTVRFloatPoint structure pointed to by the coord parameter, the coordinates of the point in the full panorama of the movie specified by the qtvr parameter that corresponds to the pan and tilt angles specified by the panAngle and tiltAngle parameters.

SPECIAL CONSIDERATIONS

QTVRAnglesToCoord is valid only for panoramic nodes.

SEE ALSO

Use QTVRCoordToAngles to get a pair of pan and tilt angles from a floating-point coordinate.

QTVRPanToColumn

You can use the QTVRPanToColumn function to get the column number in the object image array that corresponds to a pan angle.

short QTVRPanToColumn (QTVRInstance qtvr, float panAngle);
qtvr
An instance of a QuickTime VR movie.
panAngle
A pan angle.
function result
The column number in the object image array that corresponds to the specified pan angle.

DESCRIPTION

The QTVRPanToColumn function returns, as its function result, the zero-based column number in the current object image array that corresponds to the pan angle specified by the panAngle parameter.

SPECIAL CONSIDERATIONS

QTVRPanToColumn is valid only for object nodes.

QTVRColumnToPan

You can use the QTVRColumnToPan function to get the pan angle that corresponds to a column number in the object image array.

float QTVRColumnToPan (QTVRInstance qtvr, short column);
qtvr
An instance of a QuickTime VR movie.
column
A column number.
function result
The pan angle that corresponds to the specified column number in the object image array.

DESCRIPTION

The QTVRColumnToPan function returns, as its function result, the pan angle that corresponds to the zero-based column number in the object image array specified by the column parameter.

SPECIAL CONSIDERATIONS

QTVRColumnToPan is valid only for object nodes.

QTVRTiltToRow

You can use the QTVRTiltToRow function to get the row number in the object image array that corresponds to a tilt angle.

short QTVRTiltToRow (QTVRInstance qtvr, float tiltAngle);
qtvr
An instance of a QuickTime VR movie.
tiltAngle
A tilt angle.
function result
The row number in the object image array that corresponds to the specified tilt angle.

DESCRIPTION

The QTVRTiltToRow function returns, as its function result, the zero-based row number in the current object image array that corresponds to the tilt angle specified by the tiltAngle parameter.

SPECIAL CONSIDERATIONS

QTVRTiltToRow is valid only for object nodes.

QTVRRowToTilt

You can use the QTVRRowToTilt function to get the tilt angle that corresponds to a row number in the object image array.

float QTVRRowToTilt (QTVRInstance qtvr, short row);
qtvr
An instance of a QuickTime VR movie.
row
A row number.
function result
The tilt angle that corresponds to the specified row number in the object image array.

DESCRIPTION

The QTVRRowToTilt function returns, as its function result, the tilt angle that corresponds to the zero-based row number in the object image array specified by the row parameter.

SPECIAL CONSIDERATIONS

QTVRRowToTilt is valid only for object nodes.

QTVRWrapAndConstrain

You can use the QTVRWrapAndConstrain function to preflight a change in the viewing or control characteristics of an object or panoramic node.

OSErr QTVRWrapAndConstrain (
                     QTVRInstance qtvr,
                     short kind,
                     float value,
                     float *result);
qtvr
An instance of a QuickTime VR movie.
kind
A constraint type. See "Constraint Types" for a description of the available constraint types.
value
The desired value of the specified viewing characteristic.
result
On exit, the value to which the specified viewing characteristic would be set if it were changed.
function result
A result code.

DESCRIPTION

The QTVRWrapAndConstrain function returns, in the result parameter, the constrained or wrapped value that would result from setting the viewing or control characteristic specified by the kind parameter to the value specified by the value parameter. For example, if the kind parameter is set to kQTVRPan , then QTVRWrapAndConstrain returns the value that would result from calling the QTVRSetPanAngle function with its panAngle parameter set to value . Similarly, you can use QTVRWrapAndConstrain to find the current bounds of the view center. QTVRWrapAndConstrain takes into account the current constraints and wrapping modes of the node specified by the qtvr parameter.

QTVRWrapAndConstrain does not change the current view or other settings of the specified object or panorama.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |